wifi.setmode(wifi.STATION)
wifi.sta.config('A701', 'a15880287827')

print(type(srv))
if(srv) then
print("if(srv) = true")
srv:close()
end
wifi.eventmon.register(wifi.eventmon.STA_GOT_IP, function(T)
    srv = net.createServer(net.UDP)
    print("got ip")
    srv:on("receive", 
      function(s, data) --, port, ip) port ip 都为nil
        print(string.format("received '%s'", data))
        t = sjson.decode(data)
        for k,v in pairs(t) do print(k,v) end
      end
    )
    srv:listen(6000)
    net.multicastJoin(wifi.sta.getip(), "224.0.211.211")
 end)
 
wifi.sta.autoconnect(1)
